import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LotcarinVO, LotcarinForm, LotcarinQuery } from '@/api/access/parking-lot/lot-car-in/types';

/**
 * 查询入场信息列表
 * @param query
 * @returns {*}
 */

export const listLotcarin = (query?: LotcarinQuery): AxiosPromise<LotcarinVO[]> => {
  return request({
    url: '/parkinglot/lotCarIn/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询入场信息详细
 * @param parkingLotCarInId
 */
export const getLotcarin = (parkingLotCarInId: string | number): AxiosPromise<LotcarinVO> => {
  return request({
    url: '/parkinglot/lotCarIn/' + parkingLotCarInId,
    method: 'get'
  });
};

/**
 * 新增入场信息
 * @param data
 */
export const addLotcarin = (data: LotcarinForm) => {
  return request({
    url: '/parkinglot/lotCarIn',
    method: 'post',
    data: data
  });
};

/**
 * 修改入场信息
 * @param data
 */
export const updateLotcarin = (data: LotcarinForm) => {
  return request({
    url: '/parkinglot/lotCarIn',
    method: 'put',
    data: data
  });
};

/**
 * 删除入场信息
 * @param parkingLotCarInId
 */
export const delLotcarin = (parkingLotCarInId: string | number | Array<string | number>) => {
  return request({
    url: '/parkinglot/lotCarIn/' + parkingLotCarInId,
    method: 'delete'
  });
};
